<script setup>
import { inject } from 'vue';
import EarnMoney from './EarnMoney.vue'


// 定义一个变量存储money
// 取值时，参数和provide()函数的第一个参数名称一致
const money = inject("myMoney");
</script>

<template>
<button class="btnClass" @click="money -= 300">花钱</button>
<EarnMoney></EarnMoney>
</template>

<style>
 
</style>